package com.msb.serviceorder.feign;

import com.msb.commons.dto.PriceRule;
import com.msb.commons.response.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author: chshh
 * @version: 1.0
 */
@FeignClient("service-price")
public interface ServicePriceClient {

    @GetMapping("/price-rule/get-last-version")
    public ResponseResult<PriceRule> getLastVersion(@RequestParam("fareType") String  fareType);

    @GetMapping("/price-rule/is-new")
    public ResponseResult<Boolean> isNew(@RequestParam("fareType") String fareType,@RequestParam("fareVersion") Integer fareVersion);

    @PostMapping("/price-rule/if-exists")
    public ResponseResult<Boolean> ifExists(@RequestBody PriceRule priceRule);
}
